import type { Route } from "@/typings/route";
import { lazyComponent } from "@/components/LazyComponent";

export default <Route[]>[
  {
    path: "/",
    redirect: true,
    homeRoute: true,
    hideInMenu: true,
    redirectTo: '/home'
  },
  {
    path: "/home",
    name: "home",
    icon: "home",
    Component: lazyComponent(() => import("@/pages/Home"))
  },
  // 项目管理
  {
    path: "/project",
    name: "project",
    icon: "project",
    children: [
      {
        name: 'projectList',
        path: '/project/list',
        Component: lazyComponent(() => import("@/pages/Project/List")),
      },
      {
        hideInMenu: true,
        name: 'projectCreate',
        path: '/project/list/create',
        Component: lazyComponent(() => import("@/pages/Project/Create")),
      },
      {
        hideInMenu: true,
        name: 'projectEdit',
        path: '/project/list/edit/:id',
        Component: lazyComponent(() => import("@/pages/Project/Create")),
      },
      {
        hideInMenu: true,
        name: 'projectInfo',
        path: '/project/list/edit/:id/info',
        Component: lazyComponent(() => import("@/pages/Project/Create")),
      }
    ]
  },
  // 场馆管理
  {
    path: '/venue',
    name: 'venue',
    icon: 'venue',
    children: [
      {
        path: '/venue/list',
        name: "venueList",
        Component: lazyComponent(() => import("@/pages/Venue/VenueList"))
      },
      {
        hideInMenu: true,
        name: 'venueCreate',
        path: '/venue/list/create',
        Component: lazyComponent(() => import("@/pages/Venue/VenueCreate")),
      },
      {
        hideInMenu: true,
        name: 'venueEdit',
        path: '/venue/list/edit/:venueId',
        Component: lazyComponent(() => import("@/pages/Venue/VenueEdit")),
      },
      {
        hideInMenu: true,
        name: 'hallList',
        path: '/venue/list/:venueId/halls',
        Component: lazyComponent(() => import("@/pages/Venue/HallList")),
      },
      {
        hideInMenu: true,
        name: 'hallCreate',
        path: '/venue/list/:venueId/halls/create',
        Component: lazyComponent(() => import("@/pages/Venue/HallCreate")),
      },
      {
        hideInMenu: true,
        name: 'hallEdit',
        path: '/venue/list/:venueId/halls/eedit/:hallId',
        Component: lazyComponent(() => import("@/pages/Venue/HallEdit")),
      },
    ]
  }
];

// 这里的路由不受权限和 layout 管控
export const noLayoutRoutes: Route[] = [
  {
    path: '/test',
    name: 'test',
    Component: lazyComponent(() => import("@/pages/Test"))
  },
  {
    path: '/aws',
    name: 'aws',
    Component: lazyComponent(() => import("@/pages/Aws"))
  }
];
